<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SoupRequest</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libsoup Reference Manual">
<link rel="up" href="ch07.html" title="Experimental streaming API">
<link rel="prev" href="SoupRequester.html" title="SoupRequester">
<link rel="next" href="SoupRequestHTTP.html" title="SoupRequestHTTP">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="SoupRequester.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch07.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libsoup Reference Manual</th>
<td><a accesskey="n" href="SoupRequestHTTP.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#SoupRequest.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#SoupRequest.description" class="shortcut">Description</a>
                   | 
                  <a href="#SoupRequest.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#SoupRequest.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                   | 
                  <a href="#SoupRequest.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry">
<a name="SoupRequest"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="SoupRequest.top_of_page"></a>SoupRequest</span></h2>
<p>SoupRequest — Protocol-independent streaming request interface</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="SoupRequest.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libsoup/soup.h&gt;

struct              <a class="link" href="SoupRequest.html#SoupRequest-struct" title="struct SoupRequest">SoupRequest</a>;
<a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="returnvalue">GInputStream</span></a> *      <a class="link" href="SoupRequest.html#soup-request-send" title="soup_request_send ()">soup_request_send</a>                   (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="SoupRequest.html#soup-request-send-async" title="soup_request_send_async ()">soup_request_send_async</a>             (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="returnvalue">GInputStream</span></a> *      <a class="link" href="SoupRequest.html#soup-request-send-finish" title="soup_request_send_finish ()">soup_request_send_finish</a>            (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> *result</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);

<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#goffset"><span class="returnvalue">goffset</span></a>             <a class="link" href="SoupRequest.html#soup-request-get-content-length" title="soup_request_get_content_length ()">soup_request_get_content_length</a>     (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>);
const <span class="returnvalue">char</span> *        <a class="link" href="SoupRequest.html#soup-request-get-content-type" title="soup_request_get_content_type ()">soup_request_get_content_type</a>       (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>);
<a class="link" href="SoupSession.html" title="SoupSession"><span class="returnvalue">SoupSession</span></a> *       <a class="link" href="SoupRequest.html#soup-request-get-session" title="soup_request_get_session ()">soup_request_get_session</a>            (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>);
<a class="link" href="SoupURI.html" title="SoupURI"><span class="returnvalue">SoupURI</span></a> *           <a class="link" href="SoupRequest.html#soup-request-get-uri" title="soup_request_get_uri ()">soup_request_get_uri</a>                (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>);

#define             <a class="link" href="SoupRequest.html#SOUP-REQUEST-SESSION:CAPS" title="SOUP_REQUEST_SESSION">SOUP_REQUEST_SESSION</a>
#define             <a class="link" href="SoupRequest.html#SOUP-REQUEST-URI:CAPS" title="SOUP_REQUEST_URI">SOUP_REQUEST_URI</a>
</pre>
</div>
<div class="refsect1">
<a name="SoupRequest.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----SoupRequest
         +----<a class="link" href="SoupRequestData.html" title="SoupRequestData">SoupRequestData</a>
         +----<a class="link" href="SoupRequestFile.html" title="SoupRequestFile">SoupRequestFile</a>
         +----<a class="link" href="SoupRequestHTTP.html" title="SoupRequestHTTP">SoupRequestHTTP</a>
</pre>
</div>
<div class="refsect1">
<a name="SoupRequest.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
SoupRequest implements
 <a href="http://library.gnome.org/devel/gio/unstable/GInitable.html">GInitable</a>.</p>
</div>
<div class="refsect1">
<a name="SoupRequest.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="SoupRequest.html#SoupRequest--session" title='The "session" property'>session</a>"                  <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a>*          : Read / Write / Construct Only
  "<a class="link" href="SoupRequest.html#SoupRequest--uri" title='The "uri" property'>uri</a>"                      <a class="link" href="SoupURI.html" title="SoupURI"><span class="type">SoupURI</span></a>*              : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1">
<a name="SoupRequest.description"></a><h2>Description</h2>
<p>
A <a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> is created by <a class="link" href="SoupRequester.html" title="SoupRequester"><span class="type">SoupRequester</span></a>, and represents a
request to retrieve a particular URI.
</p>
</div>
<div class="refsect1">
<a name="SoupRequest.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="SoupRequest-struct"></a><h3>struct SoupRequest</h3>
<pre class="programlisting">struct SoupRequest;</pre>
<p>
A request to retrieve a particular URI.
</p>
<p class="since">Since 2.34</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-request-send"></a><h3>soup_request_send ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="returnvalue">GInputStream</span></a> *      soup_request_send                   (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Synchronously requests the URI pointed to by <em class="parameter"><code>request</code></em>, and returns
a <a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="type">GInputStream</span></a> that can be used to read its contents.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>a <a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="type">GInputStream</span></a> that can be used to
read from the URI pointed to by <em class="parameter"><code>request</code></em>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.34</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-request-send-async"></a><h3>soup_request_send_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                soup_request_send_async             (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
Begins an asynchronously request for the URI pointed to by
<em class="parameter"><code>request</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>a <a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>callback</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.34</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-request-send-finish"></a><h3>soup_request_send_finish ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="returnvalue">GInputStream</span></a> *      soup_request_send_finish            (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> *result</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Gets the result of a <a class="link" href="SoupRequest.html#soup-request-send-async" title="soup_request_send_async ()"><code class="function">soup_request_send_async()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>a <a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td>the <a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="type">GInputStream</span></a> that can be used to
read from the URI pointed to by <em class="parameter"><code>request</code></em>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.34</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-request-get-content-length"></a><h3>soup_request_get_content_length ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#goffset"><span class="returnvalue">goffset</span></a>             soup_request_get_content_length     (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>);</pre>
<p>
Gets the length of the data represented by <em class="parameter"><code>request</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>a <a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the length of the data represented by <em class="parameter"><code>request</code></em>,
or -1 if not known.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.34</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-request-get-content-type"></a><h3>soup_request_get_content_type ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *        soup_request_get_content_type       (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>);</pre>
<p>
Gets the type of the data represented by <em class="parameter"><code>request</code></em>. As in the
HTTP Content-Type header, this may include parameters after
the MIME type.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>a <a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the type of the data represented by <em class="parameter"><code>request</code></em>,
or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if not known.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.34</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-request-get-session"></a><h3>soup_request_get_session ()</h3>
<pre class="programlisting"><a class="link" href="SoupSession.html" title="SoupSession"><span class="returnvalue">SoupSession</span></a> *       soup_request_get_session            (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>);</pre>
<p>
Gets <em class="parameter"><code>request</code></em>'s <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>a <a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>request</code></em>'s <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.34</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-request-get-uri"></a><h3>soup_request_get_uri ()</h3>
<pre class="programlisting"><a class="link" href="SoupURI.html" title="SoupURI"><span class="returnvalue">SoupURI</span></a> *           soup_request_get_uri                (<em class="parameter"><code><a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a> *request</code></em>);</pre>
<p>
Gets <em class="parameter"><code>request</code></em>'s URI
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>request</code></em> :</span></p></td>
<td>a <a class="link" href="SoupRequest.html" title="SoupRequest"><span class="type">SoupRequest</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<em class="parameter"><code>request</code></em>'s URI. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.34</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-REQUEST-SESSION:CAPS"></a><h3>SOUP_REQUEST_SESSION</h3>
<pre class="programlisting">#define SOUP_REQUEST_SESSION "session"
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-REQUEST-URI:CAPS"></a><h3>SOUP_REQUEST_URI</h3>
<pre class="programlisting">#define SOUP_REQUEST_URI     "uri"
</pre>
<p>
</p>
</div>
</div>
<div class="refsect1">
<a name="SoupRequest.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="SoupRequest--session"></a><h3>The <code class="literal">"session"</code> property</h3>
<pre class="programlisting">  "session"                  <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a>*          : Read / Write / Construct Only</pre>
<p>The request's session.</p>
</div>
<hr>
<div class="refsect2">
<a name="SoupRequest--uri"></a><h3>The <code class="literal">"uri"</code> property</h3>
<pre class="programlisting">  "uri"                      <a class="link" href="SoupURI.html" title="SoupURI"><span class="type">SoupURI</span></a>*              : Read / Write / Construct Only</pre>
<p>The request URI.</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>